package com.cskaoyan.controller.wxcontroller;

import com.cskaoyan.bean.pojo.ObjectStorage;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.service.ObjectStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("wx/storage")
public class WxStorageController {

    @Autowired
    ObjectStorageService objectStorageService;

    @PostMapping("upload")
    public BaseRespVo uploadFile(MultipartFile file) {
        ObjectStorage objectStorage = objectStorageService.uploadFile(file);
        return BaseRespVo.ok(objectStorage);
    }
}